package cn.edu.zhku.citrusmonitor.baseinfo.disease.dao;

import java.sql.SQLException;
import java.util.List;

import cn.edu.zhku.citrusmonitor.domain.Bean;
import cn.edu.zhku.citrusmonitor.domain.TbDisease;

/**
 * @author 欣裕
 * @date 2018年8月2日
 * 
 */
public interface DiseaseDao {

	int addDiseaseByDiseaseBean(TbDisease disease) throws SQLException;

	int removeDiseaseByDiseaseId(String diseaseId) throws SQLException;

	int modifyDiseaseByDiseaseBean(TbDisease disease) throws SQLException;

	/**
	 * 获取全部病害数目
	 * @return
	 * @throws SQLException
	 */
	Long getCount() throws SQLException;

	/**
	 * 获取某条病害的全部信息
	 * @param diseaseId
	 * @return
	 * @throws SQLException
	 */
	List<TbDisease> getDiseaseById(String diseaseId) throws SQLException;

	/**
	 * 获取最近病害列表，前端显示
	 * @param pageSize
	 * @return
	 * @throws SQLException
	 */
	List<Bean> getRecentPestBeanList(Integer pageSize) throws SQLException;

	/**
	 * 前端分页显示病害，返回bean类
	 * @param currentPage
	 * @param pageSize
	 * @return
	 * @throws SQLException
	 */
	List<Bean> getDiseaseBeanList(Integer currentPage, Integer pageSize) throws SQLException;

	/**
	 * 返回病害全部信息，分页显示
	 * @param currentPage
	 * @param pageSize
	 * @return
	 * @throws SQLException
	 */
	List<TbDisease> getDiseaseDetailBeanList(Integer currentPage, Integer pageSize) throws SQLException;

	/**
	 * 搜索关键字，返回结果数
	 * @param word
	 * @return
	 * @throws SQLException
	 */
	Long searchDiseasetCountByWord(String word) throws SQLException;

	/**
	 * 搜索关键字
	 * @param currentPage
	 * @param pageSize
	 * @param word
	 * @return
	 * @throws SQLException
	 */
	List<TbDisease> searchDiseaseByWord(Integer currentPage, Integer pageSize, String word) throws SQLException;

	/**
	 * 前端显示病害正文，返回bean类
	 * @param id
	 * @return
	 * @throws SQLException
	 */
	Bean showDiseaseById(String id) throws SQLException;

	/**
	 * 批量删除
	 * @param ids
	 * @return
	 * @throws SQLException
	 */
	int[] delSelect(String[] ids) throws SQLException;

}
